<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsCategoryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods_category', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('商品分类简称');
            $table->unsignedInteger('pid')->default(0)->comment('pid');
            $table->unsignedInteger('level')->default(0)->comment('');
            $table->unsignedTinyInteger('is_visible')->default(1)->comment('是否显示  0 不显示  1 显示 ');
            $table->string('keywords')->comment('关键词');
            $table->string('description')->nullable()->comment('分类描述');
            $table->unsignedTinyInteger('sort')->comment('排序');
            $table->string('category_pic')->nullable()->comment('分类图片');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods_category');
    }
}
